package org.zjx.common.route.bean;

import lombok.Data;

import java.util.Objects;

@Data
public class Address {
    private String city;
    private int x;
    private int y;

    public Address() {
    }

    public Address(String city, int x, int y) {
        this.city = city;
        this.x = x;
        this.y = y;
    }

    // 重写 equals 方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Address address = (Address) o;
        return x == address.x && y == address.y && Objects.equals(city, address.city);
    }

    // 重写 hashCode 方法
    @Override
    public int hashCode() {
        return Objects.hash(city, x, y);
    }
}
